import numpy as np
import pandas as pd
numlist = [-0.5,0.75,1.0,-2]
series_examples1 = pd.Series(numlist)
ind1 = series_examples1
print(series_examples1.index)
series_examples2 = pd.Series(numlist,index = ['a','b','c','d'])
ind2 = series_examples.index
print(ind2)
series_examples
執行完會加上 自己自定的 a , b , c ,d 為 index
import numpy as np...
RangeIndex(start=0, stop=4, step=1)
Index(['a', 'b', 'c', 'd'], dtype='object')
a -0.50
b 0.75
c 1.00
d -2.00
dtype: float64
與昨天的程式結果
0 -0.50
1 0.75
2 1.00
3 -2.00
dtype: float64
差在index是我們自定義的
可以為英文